package com.qfedu.service.impl;

import com.github.pagehelper.PageHelper;
import com.qfedu.dao.JobDao;
import com.qfedu.pojo.Job;
import com.qfedu.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JobServiceImpl implements JobService {

    @Autowired
    private JobDao jobDao;

    @Override
    public void addJod(Job job) {
        jobDao.addJob(job);
    }

    @Override
    public void deleteJob(Integer id) {
        jobDao.deleteJob(id);
    }

    @Override
    public void updateJob(Job job) {

        jobDao.updateJob(job);
    }

    @Override
    public Job findById(Integer id) {
        Job job = jobDao.findById(id);
        return job;
    }

    @Override
    public List<Job> selectAll(Integer page, Integer limit) {
        PageHelper.startPage(page,limit);
        List<Job> jobs = jobDao.findAll(page);
        return jobs;
    }
}
